#region Using
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
#endregion Using

namespace PhotoGallery.Core.Business
{
    [Serializable]
    public class FolderDesc : Business.BusinessBase<FolderDesc, int>
    {
        #region Fields and Properties

        private String eventDesc = String.Empty;
        /// <summary>
        /// 
        /// </summary>
        public String EventDesc
        {
            get { return eventDesc; }
            set
            {
                if (value != eventDesc)
                {
                    MarkChanged("EventDesc");
                    eventDesc = value;
                }
            }
        }

        private String outerLocation = String.Empty;
        /// <summary>
        /// 
        /// </summary>
        public String OuterLocation
        {
            get { return outerLocation; }
            set
            {
                if (value != outerLocation)
                {
                    MarkChanged("OuterLocation");
                    outerLocation = value;
                }
            }
        }

        private String innerLocation = String.Empty;
        /// <summary>
        /// 
        /// </summary>
        public String InnerLocation
        {
            get { return innerLocation; }
            set
            {
                if (value != innerLocation)
                {
                    MarkChanged("InnerLocation");
                    innerLocation = value;
                }
            }
        }

        private String guest = String.Empty;
        /// <summary>
        /// 
        /// </summary>
        public String Guest
        {
            get { return guest; }
            set
            {
                if (value != guest)
                {
                    MarkChanged("Guest");
                    guest = value;
                }
            }
        }

        private String otherLeader = String.Empty;
        /// <summary>
        /// 
        /// </summary>
        public String OtherLeader
        {
            get { return otherLeader; }
            set
            {
                if (value != otherLeader)
                {
                    MarkChanged("OtherLeader");
                    otherLeader = value;
                }
            }
        }

        private String leader = String.Empty;
        /// <summary>
        /// 
        /// </summary>
        public String Leader
        {
            get { return leader; }
            set
            {
                if (value != leader)
                {
                    MarkChanged("Leader");
                    leader = value;
                }
            }
        }

        private String photographer = String.Empty;
        /// <summary>
        /// 
        /// </summary>
        public String Photographer
        {
            get { return photographer; }
            set
            {
                if (value != photographer)
                {
                    MarkChanged("Photographer");
                    photographer = value;
                }
            }
        }

        private String keyWord = String.Empty;
        /// <summary>
        /// 
        /// </summary>
        public String KeyWord
        {
            get { return keyWord; }
            set
            {
                if (value != keyWord)
                {
                    MarkChanged("KeyWord");
                    keyWord = value;
                }
            }
        }

        private DateTime endDate = DateTime.MinValue;
        /// <summary>
        /// 
        /// </summary>
        public DateTime EndDate
        {
            get { return endDate; }
            set
            {
                if (value != endDate)
                {
                    MarkChanged("EndDate");
                    endDate = value;
                }
            }
        }

        private DateTime startDate = DateTime.MinValue;
        /// <summary>
        /// 
        /// </summary>
        public DateTime StartDate
        {
            get { return startDate; }
            set
            {
                if (value != startDate)
                {
                    MarkChanged("StartDate");
                    startDate = value;
                }
            }
        }

        private int eventInfo = 0;
        /// <summary>
        /// 
        /// </summary>
        public int EventInfo
        {
            get { return eventInfo; }
            set
            {
                if (value != eventInfo)
                {
                    MarkChanged("EventInfo");
                    eventInfo = value;
                }
            }
        }
        
        public EventInfo EventInfoEntity { get; set; }
        
        #endregion Fields and Properties

        #region Constructors

        public FolderDesc()
        {
        }


        public FolderDesc(int id)
        {
            base.Id = id;
        }
        #endregion Constructors

        #region Base overrides

        protected override void ValidationRules()
        {
        }

        protected override FolderDesc DataSelect(int id)
        {
            return Services.DALService.FolderDescService.Select(id);
        }

        protected override void DataUpdate()
        {
            Services.DALService.FolderDescService.Update(this);
        }

        protected override void DataInsert()
        {
            Services.DALService.FolderDescService.Insert(this);
        }

        protected override void DataDelete()
        {
            Services.DALService.FolderDescService.Delete(this);
        }

        #endregion Base overrides

        public static FolderDesc Find(int? folderid)
        {
            if (folderid == null || !folderid.HasValue)
                throw new ArgumentException("the folder for search folder description is null!!! ");

            return Services.DALService.FolderDescService.Find(folderid.Value);
        }

        public static FolderDesc Find(PicNode folder)
        {
            if (folder == null)
                throw new ArgumentException("the folder for search folder description is null!!! ");
            return Find(folder.Id);
        }
    }
}
